/*
 * @Author: 孙大大
 * @Date: 2022-03-07 16:38:26
 * @LastEditTime: 2022-03-08 19:39:23
 * @FilePath: \toutiao\src\api\user.js
 */
import request from "@/utils/request";
import store from "@/store";

// 实现登录的接口
export const login = (data) => {
  return request({
    method: "POST",
    url: "/v1_0/authorizations",
    data,
  });
};

export const sendSms = (mobile) => {
  return request({
    method: "GET",
    url: `/v1_0/sms/codes/${mobile}`,
  });
};

// 获取个人信息
export const getUserInfo = () => {
  return request({
    method: "GET",
    url: "/v1_0/user",
    // headers: {
    //   Authorization: `Bearer ${store.state.user.token}`,
    // },
  });
};
